class @MessagesModel extends Backbone.Model
    defaults:
        Messages:[]
        Size:10
        Page:1
        Direction:0
        Column:"Email"
        Filter:
            Email:''
            DateOfSend:''
    url:->
        url = SiteMap.Messages.UserListing
        url = url + "?page=" + @attributes.Page
        url = url + "&size=" + @attributes.Size
        url = url + "&Column=" + @attributes.Column
        url = url + "&Direction=" + @attributes.Direction
        url = url + "&Filter.Email=" + @attributes.Email
        url = url + "&Filter.DateOfSend=" + @attributes.DateOfSend
        return url
    parse: (response) ->
        item={}
        item.Size = response.Size
        item.Page = response.Page
        item.TotalPages = response.TotalPages
        item.Column = response.Column
        item.Direction = response.Direction
        item.Filter = {};
        if response.Filter.Login?
            item.Filter.Login = response.Filter.Login
        if response.Filter.DateOfSend?
            item.Filter.DateOfSend = response.Filter.DateOfSend
        item.Messages = response.Messages
        return item